
#include <machine/asm.h>
#  ifdef BCOPY
ENTRY(bcopy)
	pushl	%esi
	pushl	%edi
	movl	12(%esp), %esi
	movl	16(%esp), %edi
	jmp	__memmove_start
#  endif
#  if defined(MEMMOVE)
ENTRY(memcpy)
ENTRY(memmove)
	pushl	%esi
	pushl	%edi
	movl	12(%esp), %edi
	movl	16(%esp), %esi
	.globl __memmove_start
__memmove_start:
	movl	20(%esp), %ecx
	pushl	%edi
	testl %ecx, %ecx
	jz 2f
	cmpl	%esi, %edi
	jb 1f
	addl %ecx, %esi
	decl %esi
	addl %ecx, %edi
	decl %edi
	std
1:
	rep
	movsb
2:
	cld
	popl	%eax
	popl	%edi
	popl	%esi
	ret
END(memcpy)
END(memmove)
#  endif /* MEMMOVE */
#  ifdef BCOPY
END(bcopy)
#  endif
